//
//  BlueCommonData.h
//  WealthGoods
//
//  Created by yisheng chen on 2023/11/27.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
typedef void(^BlueDataBlock)(NSData *blueData);
@interface BlueCommonData : NSObject

//1.1 APP端发起更新
+ (NSData *)createFirmwareUpdatePacketWithFileSize:(NSUInteger)fileSize;
//1.2 APP回复数据指令
+ (void)sendDataPacket:(NSData *)fileData andLocation:(NSInteger)location andBlock:(BlueDataBlock)block;
//1.3 设备的响应更新及请求文件数据(不需要)
+ (void)sendControlPacketWithFileAddress:(uint32_t)fileAddress dataLength:(Byte)dataLength andBlock:(BlueDataBlock)block;
//2.1 发起校验
+ (NSData *)buildCommandPacketWithVersion:(uint16_t)version;
//2.2 回应校验(不需要)
+ (NSData *)buildResponsePacket;

//3.3 获取版本号
+ (NSData *)buildCommandPacketWithVersionNum;
@end

NS_ASSUME_NONNULL_END
